home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / HAM_RAD / 3345.ZIP / NKFDRV.DOC < prev    next >
Text File  |  1988-06-19  |  3KB  |  71 lines

  1. Documentation for NKFSA v0.96 User-Written Drivers...
  2.  
  3. NKFSA can be interfaced to any A/D hardware via a User-Written Driver Program.
  4.  
  5. This document describes the interface between NKFSA and the driver, and 
  6. describes the example driver that comes with NKFSA.
  7.  
  8. NKFSA calls the driver via a software interrupt.  You get to choose which
  9. software interrupt NKFSA will use for this purpose.  The default is int 0F1H.
  10. It is assumed that the driver is written in the form of a TSR.  TSR is DOS 
  11. nomenclature for a program that uses the DOS Terminate-and-Stay-Resident 
  12. function.
  13.  
  14. Once your driver is written and working, you simply execute it, which will
  15. cause it to load, initialize itself, then, of course, terminate-and-stay-
  16. resident.  After that, anytime NKFSA is run, it can use the driver and access
  17. your A/D.
  18.  
  19. An example driver SAMTSR.COM is provided.  Because it is only an example, it
  20. does not require any A/D converter hardware.  When called by NKFSA, it simply
  21. returns a fixed waveform it has stored inside.  To try SAMTSR...
  22.  
  23. >   SAMTSR           <---causes sample user-written driver to load
  24. >   NKFSA -su        <---fires up NKFSA specifying the user-written driver
  25.  
  26. When NKFSA issues software interrupt 0F1H to call the driver, the registers
  27. have the following meanings...
  28.  
  29.     AX = -1 means that this call is to set the sample rate
  30.     ES:BX = address of doubleword containing the sample rate in Hz.
  31.  
  32.     AX >0   means that this call is to fetch a buffer of samples
  33.             AX contains NUMSAM, the number of samples desired
  34.     ES:BX = address of sample buffer.  Driver must transfer NUMSAM
  35.         samples into the buffer.  Each sample is a 16-bit number
  36.             in ordinary 2's-complement form, in the range [-8192,+8191].
  37.  
  38. To make your own driver, make a copy of SAMTSR.ASM, and add the code required
  39. to talk to your A/D converter hardware.  (Give your file a new name!)
  40. The comments in SAMTSR should be adequate to guide you, even if you have never
  41. written a TSR before.  
  42.  
  43. The sample TSR provided uses interrupt 0F1H.  If this interrupt is already
  44. used by some other software you use, you may change the interrupt by editing
  45. the value of the user_supplied_driver_interrupt_number in the NKFSA.INI file,
  46. and altering the corresponding parameter in your driver TSR.  If you decide to
  47. use a different interrupt, it is strongly suggested that you choose one of the 
  48. interrupts that Microsoft & IBM have "reserved for user program interrupts".
  49. These are 60H thru 66H and 0F1H thru 0FFH.
  50.  
  51.  
  52. TSRs can be a little tricky to debug, so it is suggested that you debug the
  53. code that talks to your A/D hardware in a normal (not TSR) program before you
  54. integrate that code into SAMTSR.
  55.  
  56. To generate the executable form of your TSR...
  57.     Use MASM to make a .OBJ file
  58.     Use LINK to make a .EXE file (it will complain that there's no stack
  59.     segment, but that's normal when generating a .COM file)
  60.     Use EXE2BIN to make the .COM file  
  61.  
  62. Alternatively, if you don't want to write in assembler, i'm told some compilers
  63. now are able to generate TSRs.  If you have one, great, but don't ask me
  64. questions about that.  I've never tried it.
  65.  
  66. 73,
  67. Franklin Antonio
  68. N6NKF
  69. 06/17/88
  70.  
  71.